1 /*
2 * libzplay - windows ( WIN32 ) multimedia library
3 *
4 * ver: 2.00
5 * date: 22. April, 2010.
6 *
7 * Copyright (C) 2003-2010 Zoran Cindori
8 *
9 * Author: Zoran Cindori
10 * Web: http://libzplay.sourceforge.net/
11 * Email: zcindori@inet.hr
12 *
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 *
29 *
30 * Supported by:
31 *
32 * ============================================================================
33 * libmad - MPEG audio decoder library
34 * Copyright (C) 2000-2004 Underbit Technologies, Inc. <support@underbit.com>
35 * http://www.underbit.com/products/mad/
36 * GNU General Public License ( GPL.TXT )
37 * ============================================================================
38 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002
39 * by the Xiph.Org Foundation http://www.xiph.org/
40 * BSD-STYLE SOURCE LICENSE ( XIPH.TXT )
41 * ============================================================================
42 * LIBA52
43 * free library for decoding ATSC A/52 streams.
44 * It is released under the terms of the GPL license.
45 * ============================================================================
46 * FLAC - Free Lossless Audio Codec
47 * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson
48 * http://flac.sourceforge.net/
49 *
50 * This file is part the FLAC project. FLAC is comprised of several
51 * components distributed under difference licenses. The codec libraries
52 * are distributed under Xiph.Org's BSD-like license (see the file
53 * XIPH.TXT in this distribution). All other programs, libraries, and
54 * plugins are distributed under the LGPL or GPL (see LGPL.TXT and
55 * GPL.TXT). The documentation is distributed under the Gnu FDL (see
56 * FDL.TXT). Each file in the FLAC distribution contains at the top the
57 * terms under which it may be distributed.
58 *
59 * Since this particular file is relevant to all components of FLAC,
60 * it may be distributed under the Xiph.Org license, which is the least
61 * restrictive of those mentioned above. See the file XIPH.TXT in this
62 * distribution.
63 * ============================================================================
64 * FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
65 * Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
66 *
67 * This program is free software; you can redistribute it and/or modify
68 * it under the terms of the GNU General Public License as published by
69 * the Free Software Foundation; either version 2 of the License, or
70 * (at your option) any later version.
71 *
72 * This program is distributed in the hope that it will be useful,
73 * but WITHOUT ANY WARRANTY; without even the implied warranty of
74 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
75 * GNU General Public License for more details.
76 *
77 * You should have received a copy of the GNU General Public License
78 * along with this program; if not, write to the Free Software
79 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
80 *
81 * Any non-GPL usage of this software or parts of this software is strictly
82 * forbidden.
83 *
84 * The "appropriate copyright message" mentioned in section 2c of the GPLv2
85 * must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
86 *
87 * Commercial non-GPL licensing of this software is possible.
88 * For more info contact Nero AG through Mpeg4AAClicense@nero.com.
89 *
90 * ============================================================================
91 * FAAC - Freeware Advanced Audio Coder Copyright (C) 2001 M. Bakker
92 * This library is free software; you can redistribute it and/or modify it
93 * under the terms of the GNU Lesser General Public License as published by the
94 * Free Software Foundation; either version 2.1 of the License, or
95 * (at your option) any later version.
96 *
97 * This library is distributed in the hope that it will be useful,
98 * but WITHOUT ANY WARRANTY; without even the implied warranty of
99 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
100 * See the GNU Lesser General Public License for more details.
101 *
102 * You should have received a copy of the GNU Lesser General Public License
103 * along with this library; if not, write to the Free Software Foundation,
104 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
105 *
106 * ============================================================================
107 * libmp3lame encoder
108 * LAME 3.xx LAME Ain't an MP3 Encoder http://www.mp3dev.org March 2001
109 *
110 * Originally developed by Mike Cheng (www.uq.net.au/~zzmcheng).
111 * Now maintained by Mark Taylor (www.mp3dev.org).
112 *
113 * This code is distributed under the GNU LESSER PUBLIC LICENSE (LGPL, see www.gnu.org)
114 * with the following modification:
115 *
116 * If you determine that distribution of LAME requires a patent license,
117 * and you obtain a patent license, you may distribute LAME even though redistribution
118 * of LAME may also require a patent license.
119 *
120 * You agree not to enforce any patent claims for any aspect of MPEG audio compression,
121 * or any other techniques contained in the LAME source code.
122 *
123 * Copyrights (c) 1999-1007 by The LAME Project Copyrights (c) 1999,2000,2001
124 * by Mark Taylor Copyrights (c) 1999,2000,2001 by Mark Taylor Copyrights
125 * (c) 1998 by Michael Cheng Copyrights (c) 1995,1996,1997 by Michael Hipp: mpglib
126 *
127 * ============================================================================
128 * SoundTouch library Copyright (c) Olli Parviainen 2002-2009
129 * http://www.surina.net/soundtouch
130 * GNU Lesser General Public License vesrion 2.1 (LGPL.TXT )
131 * ============================================================================
132 * Center Cut DSP Plugin for Winamp 2.x
133 * Copyright (C) 2004 Moitah (moitah@yahoo.com)
134 * GNU General Public License ( GPL.TXT )
135 * ============================================================================
136 * Shibatch Super Equalizer ver 0.03 for winamp
137 * written by Naoki Shibata shibatch@users.sourceforge.net
138 * http://shibatch.sourceforge.net/
139 *
140 * Shibatch Super Equalizer (except FFT part) is distributed under LGPL.
141 * See LGPL.txt for details.
142 * FFT part is a routine made by Mr.Ooura. This routine is a freeware.
143 * Contact Mr.Ooura for details of distributing licenses.
144 * http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html
145 * ============================================================================
146 * The Independent JPEG Group's JPEG software
147 * JPEG decoding library
148 * Copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding.
149 * www.ijg.org
150 * ============================================================================
151 * ZLIB DATA COMPRESSION LIBRARY
152 * (C) 1995-2010 Jean-loup Gailly and Mark Adler
153 * http://zlib.net/
154 * ============================================================================
155 * libpng library
156 * PNG picture decoding library
157 * Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson
158 * http://www.libpng.org/
159 * ============================================================================
160 */
161
162
163
164 using namespace System;
165 using namespace System::Runtime::InteropServices;
166 using namespace System::Drawing;
167
168
169 namespace libZPlay
170 {
171
172 #pragma region Structure and Enum
173
174 public enum class TSettingID: int
175 {
176 sidWaveBufferSize = 1,
177 sidAccurateLength = 2,
178 sidAccurateSeek = 3,
179 sidSamplerate = 4,
180 sidChannelNumber = 5,
181 sidBitPerSample = 6,
182 sidBigEndian = 7
183 };
184
185 public enum class TStreamFormat: int
186 {
187
188 sfUnknown = 0,
189 sfMp3 = 1,
190 sfOgg = 2,
191 sfWav = 3,
192 sfPCM = 4,
193 sfFLAC = 5,
194 sfFLACOgg = 6,
195 sfAC3 = 7,
196 sfAacADTS = 8,
197 sfWaveIn = 9,
198 sfAutodetect = 1000
199 };
200
201
202 [StructLayout(LayoutKind::Explicit)]
203 public value class TStreamHMSTime
204 {
205 public:
206 [FieldOffset(0)]
207 System::UInt32 hour;
208 [FieldOffset(4)]
209 System::UInt32 minute;
210 [FieldOffset(8)]
211 System::UInt32 second;
212 [FieldOffset(12)]
213 System::UInt32 millisecond;
214 };
215
216 [StructLayout(LayoutKind::Explicit)]
217 public value class TStreamTime
218 {
219 public:
220 [FieldOffset(0)]
221 System::UInt32 sec;
222 [FieldOffset(4)]
223 System::UInt32 ms;
224 [FieldOffset(8)]
225 System::UInt32 samples;
226 [FieldOffset(12)]
227 TStreamHMSTime hms;
228 };
229
230 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
231 public value class TStreamInfo
232 {
233 public:
234 [FieldOffset(0)]
235 int SamplingRate;
236 [FieldOffset(4)]
237 int ChannelNumber;
238 [FieldOffset(8)]
239 bool VBR;
240 [FieldOffset(12)]
241 int Bitrate;
242 [FieldOffset(16)]
243 TStreamTime Length;
244 [FieldOffset(44)]
245 System::String ^Description;
246 };
247
248
249
250 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
251 public value class TWaveOutInfo
252 {
253 public:
254 [FieldOffset(0)]
255 System::UInt32 ManufacturerID;
256 [FieldOffset(4)]
257 System::UInt32 ProductID;
258 [FieldOffset(8)]
259 System::UInt32 DriverVersion;
260 [FieldOffset(12)]
261 System::UInt32 Formats;
262 [FieldOffset(16)]
263 System::UInt32 Channels;
264 [FieldOffset(20)]
265 System::UInt32 Support;
266 [FieldOffset(24)]
267 System::String ^ProductName;
268 };
269
270 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
271 public value class TWaveInInfo
272 {
273 public:
274 [FieldOffset(0)]
275 System::UInt32 ManufacturerID;
276 [FieldOffset(4)]
277 System::UInt32 ProductID;
278 [FieldOffset(8)]
279 System::UInt32 DriverVersion;
280 [FieldOffset(12)]
281 System::UInt32 Formats;
282 [FieldOffset(16)]
283 System::UInt32 Channels;
284 [FieldOffset(20)]
285 System::String ^ProductName;
286 };
287
288
289 public enum class TFFTWindow: int
290 {
291 fwRectangular = 1,
292 fwHamming,
293 fwHann,
294 fwCosine,
295 fwLanczos,
296 fwBartlett,
297 fwTriangular,
298 fwGauss,
299 fwBartlettHann,
300 fwBlackman,
301 fwNuttall,
302 fwBlackmanHarris,
303 fwBlackmanNuttall,
304 fwFlatTop
305 };
306
307
308
309
310 public enum class TTimeFormat: System::UInt32
311 {
312 tfMillisecond = 1,
313 tfSecond = 2,
314 tfHMS = 4,
315 tfSamples = 8
316 };
317
318 public enum class TSeekMethod: int
319 {
320 smFromBeginning = 1,
321 smFromEnd = 2,
322 smFromCurrentForward = 4,
323 smFromCurrentBackward = 8
324 };
325
326 [StructLayout(LayoutKind::Explicit)]
327 public value class TStreamLoadInfo
328 {
329 public:
330 [FieldOffset(0)]
331 System::UInt32 NumberOfBuffers;
332 [FieldOffset(4)]
333 System::UInt32 NumberOfBytes;
334 };
335
336
337
338
339 [StructLayout(LayoutKind::Explicit)]
340 public value class TEchoEffect
341 {
342 public:
343 [FieldOffset(0)]
344 int nLeftDelay;
345 [FieldOffset(4)]
346 int nLeftSrcVolume;
347 [FieldOffset(8)]
348 int nLeftEchoVolume;
349 [FieldOffset(12)]
350 int nRightDelay;
351 [FieldOffset(16)]
352 int nRightSrcVolume;
353 [FieldOffset(20)]
354 int nRightEchoVolume;
355 };
356
357 public enum class TID3Version: int
358 {
359 id3Version1 = 1,
360 id3Version2 = 2
361 };
362
363
364 public enum class TFFTGraphHorizontalScale: int
365 {
366 gsLogarithmic = 0,
367 gsLinear = 1
368 };
369
370 public enum class TFFTGraphParamID: int
371 {
372 gpFFTPoints = 1,
373 gpGraphType,
374 gpWindow,
375 gpHorizontalScale,
376 gpSubgrid,
377 gpTransparency,
378 gpFrequencyScaleVisible,
379 gpDecibelScaleVisible,
380 gpFrequencyGridVisible,
381 gpDecibelGridVisible,
382 gpBgBitmapVisible,
383 gpBgBitmapHandle,
384 gpColor1,
385 gpColor2,
386 gpColor3,
387 gpColor4,
388 gpColor5,
389 gpColor6,
390 gpColor7,
391 gpColor8,
392 gpColor9,
393 gpColor10,
394 gpColor11,
395 gpColor12,
396 gpColor13,
397 gpColor14,
398 gpColor15,
399 gpColor16
400 };
401
402 public enum class TFFTGraphType: int
403 {
404 gtLinesLeftOnTop = 0,
405 gtLinesRightOnTop,
406 gtAreaLeftOnTop,
407 gtAreaRightOnTop,
408 gtBarsLeftOnTop,
409 gtBarsRightOnTop,
410 gtSpectrum
411 };
412
413
414
415 [StructLayout(LayoutKind::Explicit)]
416 public value class TStreamStatus
417 {
418 public:
419 [FieldOffset(0)]
420 bool fPlay;
421 [FieldOffset(4)]
422 bool fPause;
423 [FieldOffset(8)]
424 bool fEcho;
425 [FieldOffset(12)]
426 bool fEqualizer;
427 [FieldOffset(16)]
428 bool fVocalCut;
429 [FieldOffset(20)]
430 bool fSideCut;
431 [FieldOffset(24)]
432 bool fChannelMix;
433 [FieldOffset(28)]
434 bool fSlideVolume;
435 [FieldOffset(32)]
436 int nLoop;
437 [FieldOffset(36)]
438 bool fReverse;
439 [FieldOffset(40)]
440 int nSongIndex;
441 [FieldOffset(44)]
442 int nSongsInQueue;
443 };
444
445
446
447
448
449 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
450 public value class TID3Info
451 {
452 public:
453 [FieldOffset(0)]
454 System::String ^Title;
455 [FieldOffset(4)]
456 System::String ^Artist;
457 [FieldOffset(8)]
458 System::String ^Album;
459 [FieldOffset(12)]
460 System::String ^Year;
461 [FieldOffset(16)]
462 System::String ^Comment;
463 [FieldOffset(20)]
464 System::String ^Track;
465 [FieldOffset(24)]
466 System::String ^Genre;
467 };
468
469 public value class TID3Picture
470 {
471
472 public:
473 bool PicturePresent;
474 int PictureType;
475 System::String ^Description;
476 Bitmap ^Bitmap;
477 System::IO::MemoryStream ^BitStream;
478 };
479
480 public value class TID3InfoEx
481 {
482 public:
483 System::String ^Title;
484 System::String ^Artist;
485 System::String ^Album;
486 System::String ^Year;
487 System::String ^Comment;
488 System::String ^Track;
489 System::String ^Genre;
490 System::String ^AlbumArtist;
491 System::String ^Composer;
492 System::String ^OriginalArtist;
493 System::String ^Copyright;
494 System::String ^URL;
495 System::String ^Encoder;
496 System::String ^Publisher;
497 int BPM;
498 TID3Picture Picture;
499 };
500
501
502 public enum class TBPMDetectionMethod: int
503 {
504 dmPeaks = 0,
505 dmAutoCorrelation
506 };
507
508
509 public enum class TFFTGraphSize: int
510 {
511 FFTGraphMinWidth = 100,
512 FFTGraphMinHeight = 60
513 };
514
515 public enum class TWaveOutMapper: System::UInt32
516 {
517 WaveOutWaveMapper = 4294967295
518 };
519
520 public enum class TWaveInMapper: System::UInt32
521 {
522 WaveInWaveMapper = 4294967295
523 };
524
525 public enum class TCallbackMessage: int
526 {
527 MsgStopAsync = 1,
528 MsgPlayAsync = 2,
529 MsgEnterLoopAsync = 4,
530 MsgExitLoopAsync = 8,
531 MsgEnterVolumeSlideAsync = 16,
532 MsgExitVolumeSlideAsync = 32,
533 MsgStreamBufferDoneAsync = 64,
534 MsgStreamNeedMoreDataAsync = 128,
535 MsgNextSongAsync = 256,
536 MsgStop = 65536,
537 MsgPlay = 131072,
538 MsgEnterLoop = 262144,
539 MsgExitLoop = 524288,
540 MsgEnterVolumeSlide = 1048576,
541 MsgExitVolumeSlide = 2097152,
542 MsgStreamBufferDone = 4194304,
543 MsgStreamNeedMoreData = 8388608,
544 MsgNextSong = 16777216,
545 MsgWaveBuffer = 33554432
546 };
547
548
549 public enum class TWaveOutFormat: System::UInt32
550 {
551 format_invalid = 0,
552 format_11khz_8bit_mono = 1,
553 format_11khz_8bit_stereo = 2,
554 format_11khz_16bit_mono = 4,
555 format_11khz_16bit_stereo = 8,
556
557 format_22khz_8bit_mono = 16,
558 format_22khz_8bit_stereo = 32,
559 format_22khz_16bit_mono = 64,
560 format_22khz_16bit_stereo = 128,
561
562 format_44khz_8bit_mono = 256,
563 format_44khz_8bit_stereo = 512,
564 format_44khz_16bit_mono = 1024,
565 format_44khz_16bit_stereo = 2048
566 };
567
568 public enum class TWaveOutFunctionality: System::UInt32
569 {
570 supportPitchControl = 1,
571 supportPlaybackRateControl = 2,
572 supportVolumeControl = 4,
573 supportSeparateLeftRightVolume = 8,
574 supportSync = 16,
575 supportSampleAccuratePosition = 32,
576 supportDirectSound = 6
577 };
578
579
580 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
581 private value class TStreamInfo_Internal
582 {
583 public:
584 [FieldOffset(0)]
585 int SamplingRate;
586 [FieldOffset(4)]
587 int ChannelNumber;
588 [FieldOffset(8)]
589 bool VBR;
590 [FieldOffset(12)]
591 int Bitrate;
592 [FieldOffset(16)]
593 TStreamTime Length;
594 [FieldOffset(44)]
595 System::IntPtr Description;
596 };
597
598
599
600 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
601 private value class TWaveOutInfo_Internal
602 {
603 public:
604 [FieldOffset(0)]
605 System::UInt32 ManufacturerID;
606 [FieldOffset(4)]
607 System::UInt32 ProductID;
608 [FieldOffset(8)]
609 System::UInt32 DriverVersion;
610 [FieldOffset(12)]
611 System::UInt32 Formats;
612 [FieldOffset(16)]
613 System::UInt32 Channels;
614 [FieldOffset(20)]
615 System::UInt32 Support;
616 [FieldOffset(24)]
617 System::IntPtr ProductName;
618 };
619
620
621 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
622 private value class TWaveInInfo_Internal
623 {
624 public:
625 [FieldOffset(0)]
626 System::UInt32 ManufacturerID;
627 [FieldOffset(4)]
628 System::UInt32 ProductID;
629 [FieldOffset(8)]
630 System::UInt32 DriverVersion;
631 [FieldOffset(12)]
632 System::UInt32 Formats;
633 [FieldOffset(16)]
634 System::UInt32 Channels;
635 [FieldOffset(20)]
636 System::IntPtr ProductName;
637 };
638
639 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
640 private value class TID3Info_Internal
641 {
642 public:
643 [FieldOffset(0)]
644 System::IntPtr Title;
645 [FieldOffset(4)]
646 System::IntPtr Artist;
647 [FieldOffset(8)]
648 System::IntPtr Album;
649 [FieldOffset(12)]
650 System::IntPtr Year;
651 [FieldOffset(16)]
652 System::IntPtr Comment;
653 [FieldOffset(20)]
654 System::IntPtr Track;
655 [FieldOffset(24)]
656 System::IntPtr Genre;
657 };
658
659
660
661 [StructLayout(LayoutKind::Explicit, CharSet=CharSet::Unicode)]
662 private value class TID3InfoEx_Internal
663 {
664 public:
665 [FieldOffset(0)]
666 IntPtr Title;
667 [FieldOffset(4)]
668 IntPtr Artist;
669 [FieldOffset(8)]
670 IntPtr Album;
671 [FieldOffset(12)]
672 IntPtr Year;
673 [FieldOffset(16)]
674 IntPtr Comment;
675 [FieldOffset(20)]
676 IntPtr Track;
677 [FieldOffset(24)]
678 IntPtr Genre;
679 [FieldOffset(28)]
680 IntPtr AlbumArtist;
681 [FieldOffset(32)]
682 IntPtr Composer;
683 [FieldOffset(36)]
684 IntPtr OriginalArtist;
685 [FieldOffset(40)]
686 IntPtr Copyright;
687 [FieldOffset(44)]
688 IntPtr URL;
689 [FieldOffset(48)]
690 IntPtr Encoder;
691 [FieldOffset(52)]
692 IntPtr Publisher;
693 [FieldOffset(56)]
694 int BPM;
695 [FieldOffset(60)]
696 int PicturePresent;
697 [FieldOffset(64)]
698 int CanDrawPicture;
699 [FieldOffset(68)]
700 IntPtr MIMEType;
701 [FieldOffset(72)]
702 int PictureType;
703 [FieldOffset(76)]
704 IntPtr Description;
705 [FieldOffset(80)]
706 IntPtr PictureData;
707 [FieldOffset(84)]
708 int PictureDataSize;
709 [FieldOffset(88)]
710 IntPtr hBitmap;
711 [FieldOffset(92)]
712 int Width;
713 [FieldOffset(96)]
714 int Height;
715 [FieldOffset(356)]
716 IntPtr reserved;
717 };
718
719
720 #pragma endregion
721 public ref class ZPlay
722 {
723
724 public:
725 delegate int TCallbackFunc(System::UInt32 objptr, int user_data, TCallbackMessage msg, System::UInt32 param1, System::UInt32 param2);
726
727
728
729 #pragma region libzplay.dll interface
730
731 private:
732
733
734 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_CreateZPlay", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
735 static System::UInt32 zplay_CreateZPlay();
736
737 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_DestroyZPlay", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
738 static int zplay_DestroyZPlay(System::UInt32 objptr);
739
740 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetSettings", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
741 static int zplay_SetSettings(System::UInt32 objptr, int nSettingID, int value);
742
743 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetSettings", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
744 static int zplay_GetSettings(System::UInt32 objptr, int nSettingID);
745
746
747 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetError", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
748 static IntPtr zplay_GetError(System::UInt32 objptr);
749
750 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetErrorW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Unicode, SetLastError=true)]
751 static IntPtr zplay_GetErrorW(System::UInt32 objptr);
752
753 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetVersion", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
754 static int zplay_GetVersion(System::UInt32 objptr);
755
756 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetFileFormat", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
757 static int zplay_GetFileFormat(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPStr)] System::String ^pchFileName);
758
759 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetFileFormatW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Unicode, SetLastError=true)]
760 static int zplay_GetFileFormatW(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPWStr)] System::String ^pchFileName);
761
762 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_OpenFile", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
763 static int zplay_OpenFile(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPStr)] System::String ^sFileName, int nFormat);
764
765 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_AddFile", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
766 static int zplay_AddFile(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPStr)] System::String ^sFileName, int nFormat);
767
768 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_OpenFileW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Unicode, SetLastError=true)]
769 static int zplay_OpenFileW(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPWStr)] System::String ^sFileName, int nFormat);
770
771 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_AddFileW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Unicode, SetLastError=true)]
772 static int zplay_AddFileW(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPWStr)] System::String ^sFileName, int nFormat);
773
774 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_OpenStream", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
775 static int zplay_OpenStream(System::UInt32 objptr, int fBuffered, int fManaged, [In()] array<System::Byte> ^sMemStream, System::UInt32 nStreamSize, int nFormat);
776
777 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_PushDataToStream", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
778 static int zplay_PushDataToStream(System::UInt32 objptr, [In()] array<System::Byte> ^sMemNewData, System::UInt32 nNewDataize);
779
780
781 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_Close", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
782 static int zplay_Close(System::UInt32 objptr);
783
784 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_Play", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
785 static int zplay_Play(System::UInt32 objptr);
786
787 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_Stop", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
788 static int zplay_Stop(System::UInt32 objptr);
789
790 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_Pause", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
791 static int zplay_Pause(System::UInt32 objptr);
792
793 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_Resume", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
794 static int zplay_Resume(System::UInt32 objptr);
795
796 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_IsStreamDataFree", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
797 static int zplay_IsStreamDataFree(System::UInt32 objptr, [In()] array<System::Byte> ^sMemNewData);
798
799 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetDynamicStreamLoad", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
800 static void zplay_GetDynamicStreamLoad(System::UInt32 objptr, TStreamLoadInfo %pStreamLoadInfo);
801
802 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetPosition", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
803 static void zplay_GetPosition(System::UInt32 objptr, TStreamTime %pTime);
804
805 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_PlayLoop", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
806 static int zplay_PlayLoop(System::UInt32 objptr, int fFormatStartTime, TStreamTime %pStartTime, int fFormatEndTime, TStreamTime %pEndTime, System::UInt32 nNumOfCycles, System::UInt32 fContinuePlaying);
807
808 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_Seek", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
809 static int zplay_Seek(System::UInt32 objptr, TTimeFormat fFormat, TStreamTime %pTime, TSeekMethod nMoveMethod);
810
811 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_ReverseMode", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
812 static int zplay_ReverseMode(System::UInt32 objptr, int fEnable);
813
814 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetMasterVolume", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
815 static int zplay_SetMasterVolume(System::UInt32 objptr, int nLeftVolume, int nRightVolume);
816
817 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetPlayerVolume", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
818 static int zplay_SetPlayerVolume(System::UInt32 objptr, int nLeftVolume, int nRightVolume);
819
820 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetMasterVolume", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
821 static void zplay_GetMasterVolume(System::UInt32 objptr, int %nLeftVolume, int %nRightVolume);
822
823 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetPlayerVolume", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
824 static void zplay_GetPlayerVolume(System::UInt32 objptr, int %nLeftVolume, int %nRightVolume);
825
826 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetBitrate", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
827 static int zplay_GetBitrate(System::UInt32 objptr, int fAverage);
828
829 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetStatus", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
830 static void zplay_GetStatus(System::UInt32 objptr, TStreamStatus %pStatus);
831
832 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_MixChannels", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
833 static int zplay_MixChannels(System::UInt32 objptr, int fEnable, System::UInt32 nLeftPercent, System::UInt32 nRightPercent);
834
835 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetVUData", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
836 static void zplay_GetVUData(System::UInt32 objptr, int %pnLeftChannel, int %pnRightChannel);
837
838 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SlideVolume", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
839 static int zplay_SlideVolume(System::UInt32 objptr, TTimeFormat fFormatStart, TStreamTime %pTimeStart, int nStartVolumeLeft, int nStartVolumeRight, TTimeFormat fFormatEnd, TStreamTime %pTimeEnd, int nEndVolumeLeft, int nEndVolumeRight);
840
841 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_EnableEqualizer", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
842 static int zplay_EnableEqualizer(System::UInt32 objptr, int fEnable);
843
844 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetEqualizerPoints", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
845 static int zplay_SetEqualizerPoints(System::UInt32 objptr, [In()] array<int> ^pnFreqPoint, int nNumOfPoints);
846
847 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetEqualizerPoints", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
848 static int zplay_GetEqualizerPoints(System::UInt32 objptr, [In(), Out()] array<int> ^pnFreqPoint, int nNumOfPoints);
849
850 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetEqualizerParam", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
851 static int zplay_SetEqualizerParam(System::UInt32 objptr, int nPreAmpGain, [In()] array<int> ^pnBandGain, int nNumberOfBands);
852
853
854 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetEqualizerParam", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
855 static int zplay_GetEqualizerParam(System::UInt32 objptr, int %nPreAmpGain, [In(), Out()] array<int> ^pnBandGain, int nNumberOfBands);
856
857 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetEqualizerPreampGain", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
858 static int zplay_SetEqualizerPreampGain(System::UInt32 objptr, int nGain);
859
860 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetEqualizerPreampGain", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
861 static int zplay_GetEqualizerPreampGain(System::UInt32 objptr);
862
863 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetEqualizerBandGain", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
864 static int zplay_SetEqualizerBandGain(System::UInt32 objptr, int nBandIndex, int nGain);
865
866 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetEqualizerBandGain", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
867 static int zplay_GetEqualizerBandGain(System::UInt32 objptr, int nBandIndex);
868
869 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_EnableEcho", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
870 static int zplay_EnableEcho(System::UInt32 objptr, int fEnable);
871
872 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_StereoCut", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
873 static int zplay_StereoCut(System::UInt32 objptr, int fEnable, int fOutputCenter, int fBassToSides);
874
875
876 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetEchoParam", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
877 static int zplay_SetEchoParam(System::UInt32 objptr, [In()] array<TEchoEffect> ^pEchoEffect, int nNumberOfEffects);
878
879 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetEchoParam", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
880 static int zplay_GetEchoParam(System::UInt32 objptr, [In(), Out()] array<TEchoEffect> ^pEchoEffect, int nNumberOfEffects);
881
882 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetFFTData", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
883 static int zplay_GetFFTData(System::UInt32 objptr, int nFFTPoints, int nFFTWindow, int %pnHarmonicNumber, [In(), Out()] array<int> ^pnHarmonicFreq, [In(), Out()] array<int> ^pnLeftAmplitude, [In(), Out()] array<int> ^pnRightAmplitude, [In(), Out()] array<int> ^pnLeftPhase, [In(), Out()] array<int> ^pnRightPhase);
884
885 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetRate", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
886 static int zplay_SetRate(System::UInt32 objptr, int nRate);
887
888 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetRate", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
889 static int zplay_GetRate(System::UInt32 objptr);
890
891 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetPitch", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
892 static int zplay_SetPitch(System::UInt32 objptr, int nPitch);
893
894 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetPitch", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
895 static int zplay_GetPitch(System::UInt32 objptr);
896
897 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetTempo", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
898 static int zplay_SetTempo(System::UInt32 objptr, int nTempo);
899
900 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetTempo", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
901 static int zplay_GetTempo(System::UInt32 objptr);
902
903 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_DrawFFTGraphOnHDC", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
904 static int zplay_DrawFFTGraphOnHDC(System::UInt32 objptr, System::IntPtr hdc, int nX, int nY, int nWidth, int nHeight);
905
906 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_DrawFFTGraphOnHWND", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
907 static int zplay_DrawFFTGraphOnHWND(System::UInt32 objptr, System::IntPtr hwnd, int nX, int nY, int nWidth, int nHeight);
908
909 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetFFTGraphParam", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
910 static int zplay_SetFFTGraphParam(System::UInt32 objptr, int nParamID, int nParamValue);
911
912 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetFFTGraphParam", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
913 static int zplay_GetFFTGraphParam(System::UInt32 objptr, int nParamID);
914
915
916 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_LoadID3W", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
917 static int zplay_LoadID3W(System::UInt32 objptr, int nId3Version, TID3Info_Internal %pId3Info);
918
919
920 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint = "zplay_LoadID3ExW", ExactSpelling = true, CharSet = System::Runtime::InteropServices::CharSet::Ansi, SetLastError = true)]
921 static int zplay_LoadID3ExW(System::UInt32 objptr, TID3InfoEx_Internal %pId3Info, int fDecodeEmbededPicture);
922
923 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_LoadFileID3W", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Unicode, SetLastError=true)]
924 static int zplay_LoadFileID3W(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPWStr)] System::String ^pchFileName, int nFormat, int nId3Version, TID3Info_Internal %pId3Info);
925
926 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint = "zplay_LoadFileID3ExW", ExactSpelling = true, CharSet = System::Runtime::InteropServices::CharSet::Unicode, SetLastError = true)]
927 static int zplay_LoadFileID3ExW(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPWStr)] System::String ^pchFileName, int nFormat, TID3InfoEx_Internal %pId3Info, int fDecodeEmbededPicture);
928
929
930 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_DetectBPM", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
931 static int zplay_DetectBPM(System::UInt32 objptr, System::UInt32 nMethod);
932
933 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_DetectFileBPM", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
934 static int zplay_DetectFileBPM(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPStr)] System::String ^sFileName, int nFormat, System::UInt32 nMethod);
935
936 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_DetectFileBPMW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Unicode, SetLastError=true)]
937 static int zplay_DetectFileBPMW(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPWStr)] System::String ^sFileName, int nFormat, System::UInt32 nMethod);
938
939 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetCallbackFunc", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
940 static int zplay_SetCallbackFunc(System::UInt32 objptr, [MarshalAs(UnmanagedType::FunctionPtr)] TCallbackFunc ^pCallbackFunc, TCallbackMessage nMessage, int user_data);
941
942 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_EnumerateWaveOut", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
943 static int zplay_EnumerateWaveOut(System::UInt32 objptr);
944
945 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetWaveOutInfoW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
946 static int zplay_GetWaveOutInfoW(System::UInt32 objptr, System::UInt32 nIndex, TWaveOutInfo_Internal %pWaveOutInfo);
947
948
949 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetWaveOutDevice", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
950 static int zplay_SetWaveOutDevice(System::UInt32 objptr, System::UInt32 nIndex);
951
952
953
954 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_EnumerateWaveIn", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
955 static int zplay_EnumerateWaveIn(System::UInt32 objptr);
956
957
958 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetWaveInInfoW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
959 static int zplay_GetWaveInInfoW(System::UInt32 objptr, System::UInt32 nIndex, TWaveInInfo_Internal %pWaveInInfo);
960
961
962 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetWaveInDevice(", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
963 static int zplay_SetWaveInDevice(System::UInt32 objptr, System::UInt32 nIndex);
964
965
966
967 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_GetStreamInfoW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Ansi, SetLastError=true)]
968 static void zplay_GetStreamInfoW(System::UInt32 objptr, TStreamInfo_Internal %pInfo);
969
970
971 [System::Runtime::InteropServices::DllImport("libzplay.dll", EntryPoint="zplay_SetWaveOutFileW", ExactSpelling=true, CharSet=System::Runtime::InteropServices::CharSet::Unicode, SetLastError=true)]
972 static int zplay_SetWaveOutFileW(System::UInt32 objptr, [MarshalAs(UnmanagedType::LPWStr)] System::String ^sFileName, int nFormat, int fOutputToSoundcard);
973
974
975
976 #pragma endregion
977
978 #pragma region Members
979
980 #pragma endregion
981
982 #pragma region Helper functions
983
984 System::UInt32 objptr;
985
986 #pragma endregion
987
988 #pragma region Constructor and destructor
989
990 public:
991 ZPlay()
992 {
993 objptr = zplay_CreateZPlay();
994 if (objptr == 0)
995 {
996 throw gcnew Exception("Can't create libZPlay interface.");
997 }
998
999 if(GetVersion() < 190)
1000 throw gcnew Exception("Need libZPlay.dll version 1.90 and above.");
1001 }
1002
1003 private protected:
1004 ~ZPlay()
1005 {
1006 zplay_DestroyZPlay(objptr);
1007 }
1008 #pragma endregion
1009
1010 #pragma region Version
1011 public:
1012 int GetVersion()
1013 {
1014 return zplay_GetVersion(objptr);
1015 }
1016
1017 #pragma endregion
1018
1019 #pragma region Error handling
1020 System::String ^GetError()
1021 {
1022 return Marshal::PtrToStringUni(zplay_GetErrorW(objptr));
1023 }
1024
1025 #pragma endregion
1026
1027 #pragma region Open and close stream
1028
1029 TStreamFormat GetFileFormat(System::String ^FileName)
1030 {
1031 return safe_cast<TStreamFormat>(zplay_GetFileFormatW(objptr, FileName));
1032 }
1033
1034 bool OpenFile(System::String ^FileName, TStreamFormat Format)
1035 {
1036 return zplay_OpenFileW(objptr, FileName, System::Convert::ToInt32(Format)) == 1;
1037 }
1038
1039 bool SetWaveOutFile(System::String ^FileName, TStreamFormat Format, bool fOutputToSoundcard)
1040 {
1041 int s = 0;
1042 if(fOutputToSoundcard)
1043 s = 1;
1044
1045 return zplay_SetWaveOutFileW(objptr, FileName, System::Convert::ToInt32(Format), s) == 1;
1046 }
1047
1048
1049 bool AddFile(System::String ^FileName, TStreamFormat Format)
1050 {
1051 return zplay_AddFileW(objptr, FileName, System::Convert::ToInt32(Format)) == 1;
1052 }
1053
1054
1055 bool OpenStream(bool Buffered, bool Dynamic, array<System::Byte> ^%MemStream, System::UInt32 StreamSize, TStreamFormat nFormat)
1056 {
1057 int b = 0;
1058 int m = 0;
1059 if (Buffered)
1060 {
1061 b = 1;
1062 }
1063 if (Dynamic)
1064 {
1065 m = 1;
1066 }
1067 return zplay_OpenStream(objptr, b, m, MemStream, StreamSize, System::Convert::ToInt32(nFormat)) == 1;
1068 }
1069
1070
1071 bool PushDataToStream(array<System::Byte> ^%MemNewData, System::UInt32 NewDatSize)
1072 {
1073 return zplay_PushDataToStream(objptr, MemNewData, NewDatSize) == 1;
1074 }
1075
1076 bool IsStreamDataFree(array<System::Byte> ^%MemNewData)
1077 {
1078 return zplay_IsStreamDataFree(objptr, MemNewData) == 1;
1079 }
1080
1081 bool Close()
1082 {
1083 return zplay_Close(objptr) == 1;
1084 }
1085
1086 #pragma endregion
1087
1088 #pragma region Position and Seek
1089
1090
1091 void GetPosition(TStreamTime %time)
1092 {
1093 zplay_GetPosition(objptr, time);
1094 }
1095
1096 bool Seek(TTimeFormat TimeFormat, TStreamTime %Position, TSeekMethod MoveMethod)
1097 {
1098 return zplay_Seek(objptr, TimeFormat, Position, MoveMethod) == 1;
1099 }
1100
1101
1102
1103 #pragma endregion
1104
1105 #pragma region Play, Pause, Loop, Reverse
1106
1107
1108
1109 bool ReverseMode(bool Enable)
1110 {
1111 if (Enable)
1112 {
1113 return zplay_ReverseMode(objptr, 1) == 1;
1114 }
1115 else
1116 {
1117 return zplay_ReverseMode(objptr, 0) == 1;
1118 }
1119
1120 }
1121
1122 bool PlayLoop(TTimeFormat TimeFormatStart, TStreamTime %StartPosition, TTimeFormat TimeFormatEnd, TStreamTime %EndPosition, System::UInt32 NumberOfCycles, bool ContinuePlaying)
1123 {
1124 System::UInt32 continueplay = 0;
1125 if (ContinuePlaying)
1126 {
1127 continueplay = 1;
1128 }
1129 else
1130 {
1131 continueplay = 0;
1132 }
1133
1134 return zplay_PlayLoop(objptr, System::Convert::ToInt32(safe_cast<int>(TimeFormatStart)), StartPosition, System::Convert::ToInt32(safe_cast<int>(TimeFormatEnd)), EndPosition, NumberOfCycles, continueplay) == 1;
1135 }
1136
1137 bool StartPlayback()
1138 {
1139 return zplay_Play(objptr) == 1;
1140 }
1141
1142 bool StopPlayback()
1143 {
1144 return zplay_Stop(objptr) == 1;
1145 }
1146
1147 bool PausePlayback()
1148 {
1149 return zplay_Pause(objptr) == 1;
1150 }
1151
1152 bool ResumePlayback()
1153 {
1154 return zplay_Resume(objptr) == 1;
1155 }
1156
1157
1158 #pragma endregion
1159
1160 #pragma region Equalizer
1161
1162
1163 bool SetEqualizerParam(int PreAmpGain, array<int> ^%BandGain, int NumberOfBands)
1164 {
1165 return zplay_SetEqualizerParam(objptr, PreAmpGain, BandGain, NumberOfBands) == 1;
1166 }
1167
1168
1169 int GetEqualizerParam(int %PreAmpGain, array<int> ^%BandGain)
1170 {
1171 int tempnPreAmpGain1 = 0;
1172 int size = zplay_GetEqualizerParam(objptr, tempnPreAmpGain1, nullptr, 0);
1173 Array::Resize(BandGain, size);
1174 return zplay_GetEqualizerParam(objptr, PreAmpGain, BandGain, size);
1175 }
1176
1177
1178
1179 bool EnableEqualizer(bool Enable)
1180 {
1181 if (Enable)
1182 {
1183 return zplay_EnableEqualizer(objptr, 1) == 1;
1184 }
1185 return zplay_EnableEqualizer(objptr, 0) == 1;
1186 }
1187
1188 bool SetEqualizerPreampGain(int Gain)
1189 {
1190 return zplay_SetEqualizerPreampGain(objptr, Gain) == 1;
1191 }
1192
1193 int GetEqualizerPreampGain()
1194 {
1195 return zplay_GetEqualizerPreampGain(objptr);
1196 }
1197
1198 bool SetEqualizerBandGain(int BandIndex, int Gain)
1199 {
1200 return zplay_SetEqualizerBandGain(objptr, BandIndex, Gain) == 1;
1201 }
1202
1203 int GetEqualizerBandGain(int BandIndex)
1204 {
1205 return zplay_GetEqualizerBandGain(objptr, BandIndex);
1206 }
1207
1208 bool SetEqualizerPoints(array<int> ^%FreqPointArray, int NumberOfPoints)
1209 {
1210 return zplay_SetEqualizerPoints(objptr, FreqPointArray, NumberOfPoints) == 1;
1211 }
1212
1213 int GetEqualizerPoints(array<int> ^%FreqPointArray)
1214 {
1215 int size = zplay_GetEqualizerPoints(objptr, nullptr, 0);
1216 Array::Resize(FreqPointArray, size);
1217 return zplay_GetEqualizerPoints(objptr, FreqPointArray, size);
1218 }
1219 #pragma endregion
1220
1221 #pragma region Echo
1222
1223
1224 bool EnableEcho(bool Enable)
1225 {
1226 if (Enable)
1227 {
1228 return zplay_EnableEcho(objptr, 1) == 1;
1229 }
1230 return zplay_EnableEcho(objptr, 0) == 1;
1231 }
1232
1233
1234 bool SetEchoParam(array<TEchoEffect> ^%EchoEffectArray, int NumberOfEffects)
1235 {
1236 return zplay_SetEchoParam(objptr, EchoEffectArray, NumberOfEffects) == 1;
1237 }
1238
1239 int GetEchoParam(array<TEchoEffect> ^%EchoEffectArray)
1240 {
1241 int size = zplay_GetEchoParam(objptr, nullptr, 0);
1242 Array::Resize(EchoEffectArray, size);
1243 return zplay_GetEchoParam(objptr, EchoEffectArray, size);
1244 }
1245 #pragma endregion
1246
1247 #pragma region Volume and Fade
1248 bool SetMasterVolume(int LeftVolume, int RightVolume)
1249 {
1250 return zplay_SetMasterVolume(objptr, LeftVolume, RightVolume) == 1;
1251 }
1252
1253 bool SetPlayerVolume(int LeftVolume, int RightVolume)
1254 {
1255 return zplay_SetPlayerVolume(objptr, LeftVolume, RightVolume) == 1;
1256 }
1257
1258
1259 void GetMasterVolume(int %LeftVolume, int %RightVolume)
1260 {
1261 zplay_GetMasterVolume(objptr, LeftVolume, RightVolume);
1262 }
1263
1264 void GetPlayerVolume(int %LeftVolume, int %RightVolume)
1265 {
1266 zplay_GetPlayerVolume(objptr, LeftVolume, RightVolume);
1267 }
1268
1269
1270
1271
1272 bool SlideVolume(TTimeFormat TimeFormatStart, TStreamTime %TimeStart, int StartVolumeLeft, int StartVolumeRight, TTimeFormat TimeFormatEnd, TStreamTime %TimeEnd, int EndVolumeLeft, int EndVolumeRight)
1273 {
1274 return zplay_SlideVolume(objptr, TimeFormatStart, TimeStart, StartVolumeLeft, StartVolumeRight, TimeFormatEnd, TimeEnd, EndVolumeLeft, EndVolumeRight) == 1;
1275 }
1276
1277
1278 #pragma endregion
1279
1280 #pragma region Pitch, tempo, rate
1281 bool SetPitch(int Pitch)
1282 {
1283 return zplay_SetPitch(objptr, Pitch) == 1;
1284 }
1285
1286 int GetPitch()
1287 {
1288 return zplay_GetPitch(objptr);
1289 }
1290
1291 bool SetRate(int Rate)
1292 {
1293 return zplay_SetRate(objptr, Rate) == 1;
1294 }
1295
1296 int GetRate()
1297 {
1298 return zplay_GetRate(objptr);
1299 }
1300
1301 bool SetTempo(int Tempo)
1302 {
1303 return zplay_SetTempo(objptr, Tempo) == 1;
1304 }
1305
1306 int GetTempo()
1307 {
1308 return zplay_GetTempo(objptr);
1309 }
1310
1311
1312 #pragma endregion
1313
1314 #pragma region Bitrate
1315 int GetBitrate(bool Average)
1316 {
1317 if(Average)
1318 return zplay_GetBitrate(objptr, 1);
1319 else
1320 return zplay_GetBitrate(objptr, 0);
1321 }
1322
1323
1324
1325 #pragma endregion
1326
1327 #pragma region ID3 Info
1328
1329 bool LoadID3(TID3Version Id3Version, TID3Info %Info)
1330 {
1331 TID3Info_Internal tmp;
1332 if (zplay_LoadID3W(objptr, System::Convert::ToInt32(safe_cast<int>(Id3Version)), tmp) == 1)
1333 {
1334 Info.Album = Marshal::PtrToStringUni(tmp.Album);
1335 Info.Artist = Marshal::PtrToStringUni(tmp.Artist);
1336 Info.Comment = Marshal::PtrToStringUni(tmp.Comment);
1337 Info.Genre = Marshal::PtrToStringUni(tmp.Genre);
1338 Info.Title = Marshal::PtrToStringUni(tmp.Title);
1339 Info.Track = Marshal::PtrToStringUni(tmp.Track);
1340 Info.Year = Marshal::PtrToStringUni(tmp.Year);
1341 return true;
1342 }
1343 else
1344 {
1345 return false;
1346 }
1347 }
1348
1349
1350
1351 bool LoadID3Ex(TID3InfoEx %Info, bool fDecodePicture)
1352 {
1353 TID3InfoEx_Internal tmp;
1354
1355 if (zplay_LoadID3ExW(objptr, tmp, 0) == 1)
1356 {
1357 Info.Album = Marshal::PtrToStringUni(tmp.Album);
1358 Info.Artist = Marshal::PtrToStringUni(tmp.Artist);
1359 Info.Comment = Marshal::PtrToStringUni(tmp.Comment);
1360 Info.Genre = Marshal::PtrToStringUni(tmp.Genre);
1361 Info.Title = Marshal::PtrToStringUni(tmp.Title);
1362 Info.Track = Marshal::PtrToStringUni(tmp.Track);
1363 Info.Year = Marshal::PtrToStringUni(tmp.Year);
1364
1365 Info.AlbumArtist = Marshal::PtrToStringUni(tmp.AlbumArtist);
1366 Info.Composer = Marshal::PtrToStringUni(tmp.Composer);
1367 Info.OriginalArtist = Marshal::PtrToStringUni(tmp.OriginalArtist);
1368 Info.Copyright = Marshal::PtrToStringUni(tmp.Copyright);
1369 Info.Encoder = Marshal::PtrToStringUni(tmp.Encoder);
1370 Info.Publisher = Marshal::PtrToStringUni(tmp.Publisher);
1371 Info.BPM = tmp.BPM;
1372
1373 Info.Picture.PicturePresent = false;
1374 if (fDecodePicture)
1375 {
1376 try
1377 {
1378 if (tmp.PicturePresent == 1)
1379 {
1380 array<System::Byte> ^stream_data = gcnew array<System::Byte>(System::Convert::ToInt32(tmp.PictureDataSize) + 1);
1381 Marshal::Copy(tmp.PictureData, stream_data, 0, tmp.PictureDataSize);
1382 Info.Picture.BitStream = gcnew System::IO::MemoryStream();
1383 Info.Picture.BitStream->Write(stream_data, 0, tmp.PictureDataSize);
1384 Info.Picture.Bitmap = gcnew Bitmap(Info.Picture.BitStream);
1385 Info.Picture.PictureType = tmp.PictureType;
1386 Info.Picture.Description = Marshal::PtrToStringUni(tmp.Description);
1387 Info.Picture.PicturePresent = true;
1388 }
1389 else
1390 {
1391 Info.Picture.Bitmap = gcnew Bitmap(1, 1);
1392 }
1393 return true;
1394
1395 }
1396 catch(...)
1397 {
1398 Info.Picture.PicturePresent = false;
1399 }
1400 }
1401
1402
1403
1404 }
1405 else
1406 {
1407 return false;
1408 }
1409
1410 return false;
1411 }
1412
1413
1414 bool LoadFileID3(System::String ^FileName, TStreamFormat Format, TID3Version Id3Version, TID3Info %Info)
1415 {
1416 TID3Info_Internal tmp;
1417 if (zplay_LoadFileID3W(objptr, FileName, System::Convert::ToInt32(Format), System::Convert::ToInt32(safe_cast<int>(Id3Version)), tmp) == 1)
1418 {
1419 Info.Album = Marshal::PtrToStringUni(tmp.Album);
1420 Info.Artist = Marshal::PtrToStringUni(tmp.Artist);
1421 Info.Comment = Marshal::PtrToStringUni(tmp.Comment);
1422 Info.Genre = Marshal::PtrToStringUni(tmp.Genre);
1423 Info.Title = Marshal::PtrToStringUni(tmp.Title);
1424 Info.Track = Marshal::PtrToStringUni(tmp.Track);
1425 Info.Year = Marshal::PtrToStringUni(tmp.Year);
1426 return true;
1427 }
1428 else
1429 {
1430 return false;
1431 }
1432 }
1433
1434 bool LoadFileID3Ex(System::String ^FileName, TStreamFormat Format,TID3InfoEx %Info, bool fDecodePicture)
1435 {
1436 TID3InfoEx_Internal tmp;
1437
1438 if (zplay_LoadFileID3ExW(objptr, FileName, System::Convert::ToInt32(Format), tmp, 0) == 1)
1439 {
1440 Info.Album = Marshal::PtrToStringUni(tmp.Album);
1441 Info.Artist = Marshal::PtrToStringUni(tmp.Artist);
1442 Info.Comment = Marshal::PtrToStringUni(tmp.Comment);
1443 Info.Genre = Marshal::PtrToStringUni(tmp.Genre);
1444 Info.Title = Marshal::PtrToStringUni(tmp.Title);
1445 Info.Track = Marshal::PtrToStringUni(tmp.Track);
1446 Info.Year = Marshal::PtrToStringUni(tmp.Year);
1447
1448 Info.AlbumArtist = Marshal::PtrToStringUni(tmp.AlbumArtist);
1449 Info.Composer = Marshal::PtrToStringUni(tmp.Composer);
1450 Info.OriginalArtist = Marshal::PtrToStringUni(tmp.OriginalArtist);
1451 Info.Copyright = Marshal::PtrToStringUni(tmp.Copyright);
1452 Info.Encoder = Marshal::PtrToStringUni(tmp.Encoder);
1453 Info.Publisher = Marshal::PtrToStringUni(tmp.Publisher);
1454 Info.BPM = tmp.BPM;
1455
1456 Info.Picture.PicturePresent = false;
1457 if (fDecodePicture)
1458 {
1459 try
1460 {
1461 if (tmp.PicturePresent == 1)
1462 {
1463 array<System::Byte> ^stream_data = gcnew array<System::Byte>(System::Convert::ToInt32(tmp.PictureDataSize) + 1);
1464 Marshal::Copy(tmp.PictureData, stream_data, 0, tmp.PictureDataSize);
1465 Info.Picture.BitStream = gcnew System::IO::MemoryStream();
1466 Info.Picture.BitStream->Write(stream_data, 0, tmp.PictureDataSize);
1467 Info.Picture.Bitmap = gcnew Bitmap(Info.Picture.BitStream);
1468 Info.Picture.PictureType = tmp.PictureType;
1469 Info.Picture.Description = Marshal::PtrToStringUni(tmp.Description);
1470 Info.Picture.PicturePresent = true;
1471 }
1472 else
1473 {
1474 Info.Picture.Bitmap = gcnew Bitmap(1, 1);
1475 }
1476 return true;
1477
1478 }
1479 catch(...)
1480 {
1481 Info.Picture.PicturePresent = false;
1482 }
1483 }
1484 }
1485 else
1486 {
1487 return false;
1488 }
1489
1490 return false;
1491 }
1492
1493
1494
1495 #pragma endregion
1496
1497 #pragma region Callback
1498 bool SetCallbackFunc(TCallbackFunc ^CallbackFunc, TCallbackMessage Messages, int UserData)
1499 {
1500 return zplay_SetCallbackFunc(objptr, CallbackFunc, Messages, UserData) == 1;
1501 }
1502 #pragma endregion
1503
1504 #pragma region Beat-Per-Minute
1505 int DetectBPM(TBPMDetectionMethod Method)
1506 {
1507 return zplay_DetectBPM(objptr, System::Convert::ToUInt32(Method));
1508 }
1509
1510 int DetectFileBPM(System::String ^FileName, TStreamFormat Format, TBPMDetectionMethod Method)
1511 {
1512 return zplay_DetectFileBPMW(objptr, FileName, System::Convert::ToInt32(Format), System::Convert::ToUInt32(Method));
1513 }
1514 #pragma endregion
1515
1516 #pragma region FFT Graph and FFT values
1517
1518
1519 bool GetFFTData(int FFTPoints, TFFTWindow FFTWindow, int %HarmonicNumber, array<int> ^%HarmonicFreq, array<int> ^%LeftAmplitude, array<int> ^%RightAmplitude, array<int> ^%LeftPhase, array<int> ^%RightPhase)
1520 {
1521 return zplay_GetFFTData(objptr, FFTPoints, System::Convert::ToInt32(safe_cast<int>(FFTWindow)), HarmonicNumber, HarmonicFreq, LeftAmplitude, RightAmplitude, LeftPhase, RightPhase) == 1;
1522 }
1523
1524 bool DrawFFTGraphOnHDC(System::IntPtr hdc, int X, int Y, int Width, int Height)
1525 {
1526 return zplay_DrawFFTGraphOnHDC(objptr, hdc, X, Y, Width, Height) == 1;
1527 }
1528
1529 bool DrawFFTGraphOnHWND(System::IntPtr hwnd, int X, int Y, int Width, int Height)
1530 {
1531 return zplay_DrawFFTGraphOnHWND(objptr, hwnd, X, Y, Width, Height) == 1;
1532 }
1533
1534
1535 bool SetFFTGraphParam(TFFTGraphParamID ParamID, int ParamValue)
1536 {
1537 return zplay_SetFFTGraphParam(objptr, System::Convert::ToInt32(safe_cast<int>(ParamID)), ParamValue) == 1;
1538 }
1539
1540 int GetFFTGraphParam(TFFTGraphParamID ParamID)
1541 {
1542 return zplay_GetFFTGraphParam(objptr, System::Convert::ToInt32(safe_cast<int>(ParamID)));
1543 }
1544
1545
1546
1547
1548 #pragma endregion
1549
1550 #pragma region Center and side cut
1551
1552 bool StereoCut(bool Enable, bool OutputCenter, bool BassToSides)
1553 {
1554 int fOutputCenter = 0;
1555 int fBassToSides = 0;
1556 int fEnable = 0;
1557 if (OutputCenter)
1558 {
1559 fOutputCenter = 1;
1560 }
1561 if (BassToSides)
1562 {
1563 fBassToSides = 1;
1564 }
1565 if (Enable)
1566 {
1567 fEnable = 1;
1568 }
1569 return zplay_StereoCut(objptr, fEnable, fOutputCenter, fBassToSides) == 1;
1570 }
1571
1572
1573
1574 #pragma endregion
1575
1576 #pragma region Channel mixing
1577
1578
1579 bool MixChannels(bool Enable, System::UInt32 LeftPercent, System::UInt32 RightPercent)
1580 {
1581 if (Enable)
1582 {
1583 return zplay_MixChannels(objptr, 1, LeftPercent, RightPercent) == 1;
1584 }
1585 else
1586 {
1587 return zplay_MixChannels(objptr, 0, LeftPercent, RightPercent) == 1;
1588 }
1589
1590 }
1591 #pragma endregion
1592
1593 #pragma region VU Data
1594
1595 void GetVUData(int %LeftChannel, int %RightChannel)
1596 {
1597 zplay_GetVUData(objptr, LeftChannel, RightChannel);
1598 }
1599
1600 #pragma endregion
1601
1602 #pragma region Status and Info
1603
1604 void GetStreamInfo(TStreamInfo %info)
1605 {
1606 TStreamInfo_Internal tmp;
1607 zplay_GetStreamInfoW(objptr, tmp);
1608 info.Bitrate = tmp.Bitrate;
1609 info.ChannelNumber = tmp.ChannelNumber;
1610 info.SamplingRate = tmp.SamplingRate;
1611 info.VBR = tmp.VBR;
1612 info.Length = tmp.Length;
1613 info.Description = Marshal::PtrToStringUni(tmp.Description);
1614 }
1615
1616 void GetStatus(TStreamStatus %status)
1617 {
1618 zplay_GetStatus(objptr, status);
1619 }
1620
1621 void GetDynamicStreamLoad(TStreamLoadInfo %StreamLoadInfo)
1622 {
1623 zplay_GetDynamicStreamLoad(objptr, StreamLoadInfo);
1624 }
1625 #pragma endregion
1626
1627 #pragma region Wave Out and Wave In Info
1628
1629 int EnumerateWaveOut()
1630 {
1631 return zplay_EnumerateWaveOut(objptr);
1632 }
1633
1634 bool GetWaveOutInfo(System::UInt32 Index, TWaveOutInfo %Info)
1635 {
1636 TWaveOutInfo_Internal tmp;
1637 if (zplay_GetWaveOutInfoW(objptr, Index, tmp) == 0)
1638 {
1639 return false;
1640 }
1641 Info.Channels = tmp.Channels;
1642 Info.DriverVersion = tmp.DriverVersion;
1643 Info.Formats = tmp.Formats;
1644 Info.ManufacturerID = tmp.ManufacturerID;
1645 Info.ProductID = tmp.ProductID;
1646 Info.Support = tmp.Support;
1647 Info.ProductName = Marshal::PtrToStringUni(tmp.ProductName);
1648 return true;
1649 }
1650
1651 bool SetWaveOutDevice(System::UInt32 Index)
1652 {
1653 return zplay_SetWaveOutDevice(objptr, Index) == 1;
1654 }
1655
1656
1657 int EnumerateWaveIn()
1658 {
1659 return zplay_EnumerateWaveIn(objptr);
1660 }
1661
1662 bool GetWaveInInfo(System::UInt32 Index, TWaveInInfo %Info)
1663 {
1664 TWaveInInfo_Internal tmp;
1665 if (zplay_GetWaveInInfoW(objptr, Index, tmp) == 0)
1666 {
1667 return false;
1668 }
1669 Info.Channels = tmp.Channels;
1670 Info.DriverVersion = tmp.DriverVersion;
1671 Info.Formats = tmp.Formats;
1672 Info.ManufacturerID = tmp.ManufacturerID;
1673 Info.ProductID = tmp.ProductID;
1674 Info.ProductName = Marshal::PtrToStringUni(tmp.ProductName);
1675 return true;
1676 }
1677
1678 bool SetWaveInDevice(System::UInt32 Index)
1679 {
1680 return zplay_SetWaveInDevice(objptr, Index) == 1;
1681 }
1682
1683 #pragma endregion
1684
1685
1686 #pragma region Settings
1687
1688 int SetSettings(TSettingID SettingID, int Value)
1689 {
1690 return zplay_SetSettings(objptr, (int) SettingID, Value);
1691 }
1692
1693
1694 int GetSettings(TSettingID SettingID)
1695 {
1696 return zplay_GetSettings(objptr, (int) SettingID);
1697 }
1698
1699 #pragma endregion
1700
1701 };
1702
1703 }